package com.chii.colorization.utils;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.chii.colorization.R;

public class IntentHelper {


    public static void startWebActivity(Context c, String url) {
        String packageName = "com.android.chrome";
        Intent browserIntent = new Intent();
        browserIntent.setPackage(packageName);
        c.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));

    }
    public static void startEmailActivity(Context c, String url) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("message/rfc822");
        intent.putExtra(Intent.EXTRA_EMAIL, new String[]{url});
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        try{
            c.startActivity(Intent.createChooser(intent, "send email")
                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
        }catch (ActivityNotFoundException e){
        }
    }
}
